diff options
Diffstat (limited to 'src/routes/(app)/[username]/(profile)')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+layout.svelte | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 4a55c6e6..f929a602 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -1,14 +1,6 @@ <script> - import { - copy, - f, - loc, - post, - s, - sats, - success, - fail, - } from "$lib/utils"; + import { copy, f, loc, post, s, sats, success, fail } from "$lib/utils"; + import { fiat } from "$lib/store"; import { t } from "$lib/translations"; import { bech32 } from "@scure/base"; import { page } from "$app/stores"; @@ -17,13 +9,13 @@ let { data, children } = $props(); let { encode, toWords } = bech32; + let satsPerCurrency = $derived((1 * sats) / rate); let { events, rate, user, subject, src, text } = $derived(data); let { currency, npub, username: n, display } = $derived(subject); let locale = $derived(loc(user)); - let showBio = $state(); let toggleBio = () => (showBio = !showBio); @@ -76,7 +68,11 @@ <iconify-icon noobserver icon="ph:list-bold" width="32"></iconify-icon> </button> {#if subject.id === user?.id} - <a href="/settings/profile" class="btn contents" aria-label="Edit profile"> + <a + href="/settings/profile" + class="btn contents" + aria-label="Edit profile" + > <iconify-icon noobserver icon="ph:pencil-bold" width="32" ></iconify-icon> </a> @@ -284,16 +280,28 @@ </div> <div>= {f(rate, currency, locale, 0, 0)}</div> </div> - <div class="text-secondary flex ml-auto"> - <div class="flex items-center"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300" - ></iconify-icon> - {s((1 * sats) / rate)} = - {f(1, currency, locale, 0, 0)} - </div> + <div class="text-secondary flex ml-auto items-center gap-1"> + {#if satsPerCurrency >= 1} + <div>{f(1, currency, locale)} = </div> + <div class="flex items-center"> + <iconify-icon + noobserver + icon="ph:lightning-fill" + class="text-yellow-300" + ></iconify-icon> + {s(satsPerCurrency)} + </div> + {:else} + <div class="flex items-center"> + <iconify-icon + noobserver + icon="ph:lightning-fill" + class="text-yellow-300" + ></iconify-icon> + 1 + </div> + <div>= {f(1 / satsPerCurrency, currency, locale)}</div> + {/if} </div> </div> {/if} |
